NodeBox

Create visual output with Python programming code
Home Download Reference Tutorial Library Gallery About

Reference | BezierPath


Syntax
BezierPath()

DescriptionEach path in NodeBox (see for example, rect(), oval(), endpath(), textpath()) is a BezierPath object. This object has a number of properties to manipulate indivdual points in the path and can be passed to the drawpath() command to draw it on the canvas.
Properties
path[i]
path.moveto(x, y)
path.lineto(x, y)
path.curveto(h1x, h1y, h2x, h2y, x, y)
path.closepath()
path.length
path.segmentlengths(relative=False, n=10)
path.point(t)
path.points(amount=100)
path.addpoint(t)
path.contours
path.contains(x, y)

See the tutorial on paths to learn about all the properties.

With the segmentlengths() method you can define the math precision by making n a higher value (usually 10 is fine).

When you loop over a path it returns a list of PathElement objects.